<template>
  <div>
    <div class="w100 mt-20 bgff br-20 p-all-20 mb-20">
          <div class="w100 rowsc rowsm col333 fs-20 fw-b mb-20">劳动教育考核方案</div>
          <div class="fs-16 col666 mb-10">1.劳动总成绩=理论成绩x20%+实践成绩x80%</div>
          <div class="fs-16 col666  mb-10">2.实践成绩=基础劳动成绩x60%+社会公益劳动成绩x10%+劳动成果成绩x10%+劳动总结报告成绩x20%</div>
          <div class="fs-16 col666">3.基础劳动成绩=该生现有积分÷2800积分（基础劳动积分上限）x100</div>
        </div>

        <div class="w100 bgff br-20 mb-30" v-if="data">
          <div class="w100 rowsc rowsm h-60 fs-20 fw-b">1.实践成绩</div>
          <div class="w100 rows rowsm h-50" v-for="(item,index) in data.sjcj" :key="index" :style="index == 0 ? 'background-color: rgba(227, 54, 54, .1);' : index % 2 == 0 ? 'background:rgba(227, 227, 227, .47);' : 'background-color: #fff;'">
            <div class="rowsc rowsm col333 fs-20 h100 w-100" :class="{'fw-b':index == 0}">{{item[0]}}</div>
            <div class="rowsc rowsm col333 fs-20 h100 w-170" :class="{'fw-b':index == 0}"  :style="index == 1  ? 'color:#E33636;' : 'color:#333;'" @click="changeScoreIndex(index,1)">{{index == 1 || index == 3 ? Number(item[1]).toFixed(2) : item[1]}}</div>
            <div class="rowsc rowsm col333 fs-20 h100 w-170" :class="{'fw-b':index == 0}"  :style="index == 1 ? 'color:#E33636;' : 'color:#333;'" @click="changeScoreIndex(index,3)">{{index == 1 || index == 3 ? Number(item[2]).toFixed(2) : item[2]}}</div>
            <div class="rowsc rowsm col333 fs-20 h100 w-170" :class="{'fw-b':index == 0}"  :style="index == 1  ? 'color:#E33636;' : 'color:#333;'" @click="changeScoreIndex(index,4)">{{index == 1 || index == 3 ? Number(item[3]).toFixed(2) : item[3]}}</div>
            <div class="rowsc rowsm col333 fs-20 h100 w-170" :class="{'fw-b':index == 0}"  :style="index == 1  ? 'color:#E33636;' : 'color:#333;'" @click="changeScoreIndex(index,5)">{{index == 1 || index == 3 ? Number(item[4]).toFixed(2) : item[4]}}</div>
            <div class="rowsc rowsm col333 fs-20 h100 w100" :class="{'fw-b':index == 0}">{{index == 3 ? Number(item[5]).toFixed(2) : item[5]}}</div>
          </div>
         
        </div>

        <div class="w100 bgff br-20 mb-30">
          <div class="w100 rowsc rowsm h-60 fs-20 fw-b">2.理论成绩</div>
          <div class="w100 h-50 rowsb rowsm">
            <div class="h100 rowsc rowsm col333 fs-20" style="width: 50%;background-color: rgba(227, 54, 54, .1);">理论成绩</div>
            <div class="h100 rowsc rowsm col333 fs-20" style="width: 50%;background-color: rgba(227, 227, 227, .47);">{{data.llcj}}</div>
          </div>
        </div>

        <div class="w100 bgff br-20">
          <div class="w100 rowsc rowsm h-60 fs-20 fw-b">3.劳动教育总成绩</div>
          <div class="w100 h-50 rows rowsm" style="background-color: rgba(227, 54, 54, .1);">
            <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;" v-for="(item,index) in data.ldjy.list1" :key="index">{{item}}</div>
            <!-- <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">理论成绩x20%</div>
            <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">实践成绩x80%</div> -->
          </div>
          <div class="w100 h-50 rows rowsm bgff">
            <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;" v-for="(item,index) in data.ldjy.list2" :key="index">{{Number(item).toFixed(0)}}</div>
            <!-- <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">18</div>
            <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">74</div> -->
          </div>
          
        </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
        data:{}
    };
  },
  watch: {},
  computed: {},
  methods: {
    changeScoreIndex(index,i){
            if(index == 1){
              this.$emit('changeScoreIndex',i)
            }
        },
    getData(){
      this.$axios.post('prouser/getCountCj',{}).then(res => {
        if(res.data.code != 200) return this.$notify({
          title: '提示',
          message: res.data.msg
        });
        let {data} = res.data

        this.data = data
          let arr = []
          
          Object.keys(data.sjcj).sort().forEach(item => arr.push(item))
          console.log(arr)
          this.data.sjcj = arr.map(item => this.data.sjcj[item])
          console.log(this.data.sjcj)
      })
    }
  },
  created() {
    this.getData()
  },
  mounted() {}
};
</script>
<style lang="scss" scoped>
</style>